//
//  AppDelegate.m
//  oschina
//
//  Created by hjl on 16/3/30.
//  Copyright © 2016年 hjl. All rights reserved.
//

#import "AppDelegate.h"
#import "HHTabBarController.h"
#import "HHOAuthController.h"
#import "HHAccount.h"
#import "HHAccountTool.h"


@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // 初始化window
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    
    // 创建tabbar
    HHOAuthController *oa = [[HHOAuthController alloc]init];
    HHTabBarController *tb = [[HHTabBarController alloc]init];
    
    // 获取账号信息
    HHAccount *account = [HHAccountTool account];
    
    if (account) {
        self.window.rootViewController = tb;
    }else{
        self.window.rootViewController = oa;
    }
    
    // 加载window
    [self.window makeKeyAndVisible];
    
    return YES;
}



@end
